package org.example.day01;

public class MyThread7 extends Thread{
    private int i = 0;
    @Override
    public void run() {
        super.run();
        try {
            while(true){
                i++;
                System.out.println(i);
                Thread.sleep(1000);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        try {
            MyThread7 m7 = new MyThread7();
            m7.start();
            Thread.sleep(8000);
            m7.stop();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
